home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / entry.n < prev    next >
Text File  |  1995-07-25  |  21KB  |  396 lines

  1.  
  2.  
  3.  
  4.      eeeennnnttttrrrryyyy((((nnnn))))                     TTTTkkkk (((( ))))                      eeeennnnttttrrrryyyy((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           entry - Create and manipulate entry widgets
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           eeeennnnttttrrrryyyy _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  15.  
  16.      SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  17.           bbbbaaaacccckkkkggggrrrroooouuuunnnndddd      ffffoooorrrreeeeggggrrrroooouuuunnnndddd     iiiinnnnsssseeeerrrrttttWWWWiiiiddddtttthhhh     sssseeeelllleeeeccccttttFFFFoooorrrreeeeggggrrrroooouuuunnnndddd|
  18.           bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh     iiiinnnnsssseeeerrrrttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               rrrreeeelllliiiieeeefffftttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee|
  19.           ccccuuuurrrrssssoooorrrr          iiiinnnnsssseeeerrrrttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh              ssssccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd  |
  20.           eeeexxxxppppoooorrrrttttSSSSeeeelllleeeeccccttttiiiioooonnnn iiiinnnnsssseeeerrrrttttOOOOffffffffTTTTiiiimmmmeeee  sssseeeelllleeeeccccttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               |
  21.           ffffoooonnnntttt            iiiinnnnsssseeeerrrrttttOOOOnnnnTTTTiiiimmmmeeee   sssseeeelllleeeeccccttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh              |
  22.  
  23.           See the ``options'' manual entry for details on the standard
  24.           options.
  25.  
  26.      WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  27.           Name:           ssssttttaaaatttteeee                                         |
  28.           Class:          SSSSttttaaaatttteeee                                         |
  29.           Command-Line Switch:----ssssttttaaaatttteeee                                    |
  30.  
  31.                                                                              ||
  32.                Specifies  one  of two states for the entry:  nnnnoooorrrrmmmmaaaallll or  |
  33.                ddddiiiissssaaaabbbblllleeeedddd.  If the entry is disabled then the value  may  |
  34.                not  be  changed using widget commands and no insertion  |
  35.                cursor will be displayed, even if the input focus is in  |
  36.                the widget.
  37.  
  38.           Name:           wwwwiiiiddddtttthhhh
  39.           Class:          WWWWiiiiddddtttthhhh
  40.           Command-Line Switch:----wwwwiiiiddddtttthhhh
  41.  
  42.                Specifies an integer value indicating the desired width
  43.                of  the entry window, in average-size characters of the
  44.                widget's font.
  45.      _________________________________________________________________
  46.  
  47.  
  48.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  49.           The eeeennnnttttrrrryyyy  command  creates  a  new  window  (given  by  the
  50.           _p_a_t_h_N_a_m_e  argument)  and  makes  it  into  an  entry widget.
  51.           Additional options, described above, may be specified on the
  52.           command  line or in the option database to configure aspects
  53.           of the entry such as its  colors,  font,  and  relief.   The
  54.           eeeennnnttttrrrryyyy  command  returns  its _p_a_t_h_N_a_m_e argument.  At the time
  55.           this command is invoked, there must not exist a window named
  56.           _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  57.  
  58.           An entry is a widget that displays a  one-line  text  string
  59.           and  allows  that  string to be edited using widget commands
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      eeeennnnttttrrrryyyy((((nnnn))))                     TTTTkkkk (((( ))))                      eeeennnnttttrrrryyyy((((nnnn))))
  71.  
  72.  
  73.  
  74.           described below, which are typically bound to keystrokes and
  75.           mouse  actions.   When  first  created, an entry's string is
  76.           empty.  A portion of the entry may be selected as  described
  77.           below.   If  an  entry  is  exporting its selection (see the  |
  78.           eeeexxxxppppoooorrrrttttSSSSeeeelllleeeeccccttttiiiioooonnnn option), then it will observe  the  standard  |
  79.           X11  protocols for handling the selection;  entry selections
  80.           are available as type  SSSSTTTTRRRRIIIINNNNGGGG.   Entries  also  observe  the
  81.           standard Tk rules for dealing with the input focus.  When an
  82.           entry has the input focus it displays an _i_n_s_e_r_t_i_o_n _c_u_r_s_o_r to
  83.           indicate where new characters will be inserted.
  84.  
  85.           Entries are capable of displaying strings that are too  long
  86.           to  fit  entirely within the widget's window.  In this case,
  87.           only a portion of the string will  be  displayed;   commands
  88.           described  below  may  be  used  to  change  the view in the
  89.           window.  Entries use the  standard  ssssccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd  mechanism
  90.           for  interacting with scrollbars (see the description of the
  91.           ssssccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd  option  for  details).   They  also   support
  92.           scanning, as described below.
  93.  
  94.  
  95.      WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  96.           The eeeennnnttttrrrryyyy command creates a new Tcl command  whose  name  is
  97.           _p_a_t_h_N_a_m_e.   This  command  may  be  used  to  invoke various
  98.           operations on the widget.   It  has  the  following  general
  99.           form:
  100.  
  101.                _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  102.           _O_p_t_i_o_n and the _a_r_gs determine  the  exact  behavior  of  the
  103.           command.
  104.  
  105.           Many of the widget commands for entries  take  one  or  more
  106.           indices  as  arguments.   An  index  specifies  a particular
  107.           character in the entry's string, in  any  of  the  following
  108.           ways:
  109.  
  110.           _n_u_m_b_e_r      Specifies the character as  a  numerical  index,
  111.                       where  0  corresponds  to the first character in
  112.                       the string.
  113.  
  114.           eeeennnndddd         Indicates the character just after the last  one
  115.                       in  the  entry's  string.  This is equivalent to
  116.                       specifying a numerical index equal to the length
  117.                       of the entry's string.
  118.  
  119.           iiiinnnnsssseeeerrrrtttt      Indicates  the   character   adjacent   to   and  |
  120.                       immediately following the insertion cursor.
  121.  
  122.           sssseeeellll....ffffiiiirrrrsssstttt   Indicates the first character in the  selection.
  123.                       It is an error to use this form if the selection
  124.                       isn't in the entry window.
  125.  
  126.  
  127.      Page 2                                          (printed 7/23/95)
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.      eeeennnnttttrrrryyyy((((nnnn))))                     TTTTkkkk (((( ))))                      eeeennnnttttrrrryyyy((((nnnn))))
  135.  
  136.  
  137.  
  138.           sssseeeellll....llllaaaasssstttt    Indicates the last character in  the  selection.
  139.                       It is an error to use this form if the selection
  140.                       isn't in the entry window.
  141.  
  142.           @@@@_n_u_m_b_e_r     In  this  form,  _n_u_m_b_e_r  is  treated  as  an  x-
  143.                       coordinate in the entry's window;  the character
  144.                       spanning  that  x-coordinate   is   used.    For
  145.                       example,    ``@@@@0000''   indicates   the   left-most
  146.                       character in the window.
  147.  
  148.           Abbreviations may be used for any of the forms  above,  e.g.
  149.           ``eeee''  or  ``sssseeeellll....ffff''.   In general, out-of-range indices are
  150.           automatically rounded to the nearest legal value.
  151.  
  152.           The following commands are possible for entry widgets:
  153.  
  154.           _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  155.                Query  or  modify  the  configuration  options  of  the
  156.                widget.   If  no  _o_p_t_i_o_n  is  specified, returns a list
  157.                describing all of the available  options  for  _p_a_t_h_N_a_m_e
  158.                (see  TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of
  159.                this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  160.                the  command  returns  a  list describing the one named
  161.                option  (this   list   will   be   identical   to   the
  162.                corresponding  sublist  of  the  value  returned  if no
  163.                _o_p_t_i_o_n is specified).   If  one  or  more  _o_p_t_i_o_n-_v_a_l_u_e
  164.                pairs  are  specified,  then  the  command modifies the
  165.                given widget option(s) to have the given value(s);   in
  166.                this  case the command returns an empty string.  _O_p_t_i_o_n
  167.                may have any  of  the  values  accepted  by  the  eeeennnnttttrrrryyyy
  168.                command.
  169.  
  170.           _p_a_t_h_N_a_m_e ddddeeeelllleeeetttteeee _f_i_r_s_t ?_l_a_s_t?
  171.                Delete one or more elements of the  entry.   _F_i_r_s_t  and
  172.                _l_a_s_t are indices of of the first and last characters in
  173.                the range to be deleted.   If _l_a_s_t isn't  specified  it
  174.                defaults  to _f_i_r_s_t, i.e. a single character is deleted.
  175.                This command returns an empty string.
  176.  
  177.           _p_a_t_h_N_a_m_e ggggeeeetttt
  178.                Returns the entry's string.
  179.  
  180.           _p_a_t_h_N_a_m_e iiiiccccuuuurrrrssssoooorrrr _i_n_d_e_x
  181.                Arrange for the insertion cursor to be  displayed  just  |
  182.                before  the character given by _i_n_d_e_x.  Returns an empty  |
  183.                string.
  184.  
  185.           _p_a_t_h_N_a_m_e iiiinnnnddddeeeexxxx _i_n_d_e_x
  186.                Returns the numerical index corresponding to _i_n_d_e_x.
  187.  
  188.           _p_a_t_h_N_a_m_e iiiinnnnsssseeeerrrrtttt _i_n_d_e_x _s_t_r_i_n_g
  189.                Insert  the  characters  of  _s_t_r_i_n_g  just  before   the
  190.  
  191.  
  192.  
  193.      Page 3                                          (printed 7/23/95)
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.      eeeennnnttttrrrryyyy((((nnnn))))                     TTTTkkkk (((( ))))                      eeeennnnttttrrrryyyy((((nnnn))))
  201.  
  202.  
  203.  
  204.                character indicated by _i_n_d_e_x.  Returns an empty string.
  205.  
  206.           _p_a_t_h_N_a_m_e ssssccccaaaannnn _o_p_t_i_o_n _a_r_g_s
  207.                This command is used to implement scanning on  entries.
  208.                It has two forms, depending on _o_p_t_i_o_n:
  209.  
  210.                _p_a_t_h_N_a_m_e ssssccccaaaannnn mmmmaaaarrrrkkkk _x
  211.                     Records _x  and  the  current  view  in  the  entry
  212.                     window;   used  in  conjunction  with  later  ssssccccaaaannnn
  213.                     ddddrrrraaaaggggttttoooo  commands.   Typically  this   command   is
  214.                     associated  with  a  mouse  button  press  in  the
  215.                     widget.  It returns an empty string.
  216.  
  217.                _p_a_t_h_N_a_m_e ssssccccaaaannnn ddddrrrraaaaggggttttoooo _x
  218.                     This command computes the difference between its _x
  219.                     argument  and the _x argument to the last ssssccccaaaannnn mmmmaaaarrrrkkkk
  220.                     command for the widget.  It then adjusts the  view
  221.                     left  or  right  by  10 times the difference in x-
  222.                     coordinates.  This command is typically associated
  223.                     with mouse motion events in the widget, to produce
  224.                     the effect of dragging the  entry  at  high  speed
  225.                     through  the window.  The return value is an empty
  226.                     string.
  227.  
  228.           _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt _o_p_t_i_o_n _a_r_g
  229.                This command is used to adjust the selection within  an
  230.                entry.  It has several forms, depending on _o_p_t_i_o_n:
  231.  
  232.                _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt aaaaddddjjjjuuuusssstttt _i_n_d_e_x
  233.                     Locate the end of the  selection  nearest  to  the
  234.                     character  given  by _i_n_d_e_x, and adjust that end of
  235.                     the selection to be at _i_n_d_e_x  (i.e  including  but
  236.                     not  going  beyond  _i_n_d_e_x).   The other end of the
  237.                     selection is made  the  anchor  point  for  future
  238.                     sssseeeelllleeeecccctttt   ttttoooo  commands.   If  the  selection  isn't
  239.                     currently in the entry, then a  new  selection  is
  240.                     created  to  include  the characters between _i_n_d_e_x
  241.                     and  the  most  recent  selection  anchor   point,
  242.                     inclusive.  Returns an empty string.
  243.  
  244.                _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt cccclllleeeeaaaarrrr
  245.                     Clear the selection if it  is  currently  in  this
  246.                     widget.   If  the  selection  isn't in this widget
  247.                     then the command has no effect.  Returns an  empty
  248.                     string.
  249.  
  250.                _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt ffffrrrroooommmm _i_n_d_e_x
  251.                     Set the selection anchor point to just before  the
  252.                     character  given  by  _i_n_d_e_x.   Doesn't  change the
  253.                     selection.  Returns an empty string.
  254.  
  255.                _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt ttttoooo _i_n_d_e_x
  256.  
  257.  
  258.  
  259.      Page 4                                          (printed 7/23/95)
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.      eeeennnnttttrrrryyyy((((nnnn))))                     TTTTkkkk (((( ))))                      eeeennnnttttrrrryyyy((((nnnn))))
  267.  
  268.  
  269.  
  270.                     Set the selection to consist of the elements  from
  271.                     the anchor point to element _i_n_d_e_x, inclusive.  The
  272.                     anchor point is  determined  by  the  most  recent
  273.                     sssseeeelllleeeecccctttt  ffffrrrroooommmm  or  sssseeeelllleeeecccctttt  aaaaddddjjjjuuuusssstttt  command  in this
  274.                     widget.  If the selection  isn't  in  this  widget
  275.                     then  a  new  selection  is created using the most
  276.                     recent anchor  point  specified  for  the  widget.
  277.                     Returns an empty string.
  278.  
  279.           _p_a_t_h_N_a_m_e vvvviiiieeeewwww _i_n_d_e_x
  280.                Adjust the view in the entry so that element  _i_n_d_e_x  is
  281.                at  the  left  edge  of  the  window.  Returns an empty
  282.                string.
  283.  
  284.  
  285.      DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  286.           Tk automatically creates class  bindings  for  entries  that  |
  287.           give them the following default behavior:                     |
  288.  
  289.           [1]                                                                ||
  290.                Clicking  mouse  button  1  in  an  entry positions the  |
  291.                insertion cursor just before the  character  underneath  |
  292.                the  mouse  cursor  and  sets  the  input focus to this  |
  293.                widget.                                                  |
  294.  
  295.           [2]                                                                ||
  296.                Dragging  with  mouse  button 1 strokes out a selection  |
  297.                between the insertion cursor and  the  character  under  |
  298.                the mouse.                                               |
  299.  
  300.           [3]                                                                ||
  301.                The  ends  of the selection can be adjusted by dragging  |
  302.                with mouse button 1 while the shift key is down;   this  |
  303.                will  adjust  the end of the selection that was nearest  |
  304.                to the mouse cursor when button 1 was pressed.           |
  305.  
  306.           [4]                                                                ||
  307.                The  view in the entry can be adjusted by dragging with  |
  308.                mouse button 2.                                          |
  309.  
  310.           [5]                                                                ||
  311.                If the input focus is in an entry widget and characters  |
  312.                are typed on the keyboard, the characters are  inserted  |
  313.                just before the insertion cursor.                        |
  314.  
  315.           [6]                                                                ||
  316.                Control-h  and  the Backspace and Delete keys erase the  |
  317.                character just before the insertion cursor.              |
  318.  
  319.           [7]                                                                ||
  320.                Control-w  erases  the  word  just before the insertion  |
  321.                cursor.                                                  |
  322.  
  323.  
  324.  
  325.      Page 5                                          (printed 7/23/95)
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.      eeeennnnttttrrrryyyy((((nnnn))))                     TTTTkkkk (((( ))))                      eeeennnnttttrrrryyyy((((nnnn))))
  333.  
  334.  
  335.  
  336.           [8]                                                                ||
  337.                Control-u clears the entry to an empty string.           |
  338.  
  339.           [9]                                                                ||
  340.                Control-v inserts the current selection just before the  |
  341.                insertion cursor.                                        |
  342.  
  343.           [10]                                                               ||
  344.                Control-d  deletes  the  selected characters;  an error  |
  345.                occurs if the selection is not in this widget.           |
  346.  
  347.           If the entry is disabled using the ssssttttaaaatttteeee  option,  then  the  |
  348.           entry's view can still be adjusted and text in the entry can  |
  349.           still be selected, but no insertion cursor will be displayed  |
  350.           and no text modifications will take place.                    |
  351.  
  352.           The behavior of entries  can  be  changed  by  defining  new  |
  353.           bindings  for  individual widgets or by redefining the class  |
  354.           bindings.
  355.  
  356.  
  357.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  358.           entry, widget
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.      Page 6                                          (printed 7/23/95)
  392.  
  393.  
  394.  
  395.